// import _ from 'lodash'; // 使用了webpack.config.js下plugin的new webpack.ProvidePlugin注册全局插件lodash
import '../assets/css/style.css';
import Icon from '../assets/img/house.jpg';

import printMe from '../assets/js/print.js';
console.log('使用了webpack.config.js下plugin的new webpack.ProvidePlugin注册全局插件')
console.log(11, _)
console.log(22, _join)
function component() {
	var element = document.createElement('div');

	// Lodash, now imported by this script
	// element.innerHTML = _.join(['Hello', 'webpack'], ' ');
	element.innerHTML = _join(['Hello', 'webpack'], '使用webpack配置全局方法_join, _join来自于loadsh');
	
	element.classList.add('hello1');

	// 将图像添加到我们现有的 div。
	var myIcon = new Image();
	myIcon.src = Icon;
	myIcon.style.width="300px"
	myIcon.style.height="auto"

	element.appendChild(myIcon);


	// 创建按钮
	var btn = document.createElement('button');
	btn.innerHTML = 'Click me and check the console!';
   	btn.onclick = printMe;

   	element.appendChild(btn);
	return element;
}

document.body.appendChild(component());